new Vue ({
	el: "#app", 
	data: {
		searchVal: "",
		mark1: !1,
		mark2: !0,
		mark3: !0,
		ishow3: !1,
		ishidden3: !1,
		imgUrl: "https://app.meijiangzi.com/static/",
		bannerImg: [],
		mallList: [],
		ImgBaseUrl: "https://app.meijiangzi.com/static/shouye/",
		hot: 2,
		price: "",
		star: "",
		bgImg: !1,
		project_list: "",
		str: "",
		isbottom: !1,
		pageNum: 1,
		longitude: "",
		latitude: "",
		province_id: 61,
		province: "陕西省",
		project_name:'',
		isNoData: false 
    },
	methods: {
	    hotBtn: function() {
	        this.isbottom = !1, this.mark2 = !0, this.mark3 = !0, this.ishow3 = !1, this.ishidden3 = !1, 
	        this.mark1 = !1, this.hot = 2, this.star = "", this.price = "", this.pageNum = 1, 
	        this.getData(this.hot);
	    },
	    scoreBtn: function() {
	        this.isbottom = !1, this.mark1 = !0, this.mark3 = !0, this.ishow3 = !1, this.ishidden3 = !1, 
	        this.mark2 = !1, this.star = 2, this.hot = "", this.price = "", this.pageNum = 1, 
	        this.getData(this.hot);
	    },
	    priceBtn: function() {
	        this.isbottom = !1, this.mark1 = !0, this.ishow1 = !1, this.ishidden1 = !1, this.mark2 = !0, 
	        this.ishow2 = !1, this.ishidden2 = !1, this.mark3 = !1, this.ishow3 = !this.ishow3, 
	        this.ishidden3 = !this.ishow3, this.ishow3 ? this.price = 2 : 0 == this.ishow3 && (this.price = 1), 
	        this.hot = "", this.star = "", this.pageNum = 1, this.getData(this.price);
	    },
	    getData: function(t) {
	        var s = this;
	        if (this.isbottom) return !1;
	        wx.showLoading({
	            title: "加载中",
	            mask: !0
	        });
	        var i = {
	          typeId: this.str - 0,
	          currentPage: this.pageNum,
	            pageSize: 10,
	            lat: this.latitude,
	            lng: this.longitude
	          //,zoneCode: this.city_id
	        };
	        //排序
	      "" == !this.hot ? i.orderType = 1 : "" == !this.star ? i.orderType = 2 : "" == !this.price && (i.orderType = this.price + 2);
	        setTimeout(function() {
	          s.$http.post(baseUrl+"/api/project/list", i).then(function(t) {
	                wx.hideLoading();
	                var i = t.data;
	                if (!i.success) return wx.hideLoading(), wx.showToast({
	                    title: i.description,
	                    icon: "none",
	                    duration: 2e3,
	                    mask: !0
	                }), !1;
					s.isExcute = false; 
	                if (0 == i.data.length && s.mallList.length > 1) return wx.showToast({
	                    title: "已经到最底下了",
	                    icon: "none",
	                    duration: 1e3,
	                    mask: !0
	                }), s.isbottom = !0, !1;
	                if (i.data.length > 0 && 1 == s.pageNum) s.mallList = i.data; else {
	                    var a;
	                    (a = s.mallList).push.apply(a, i.data);
	                }
					if(s.mallList.length == 0){
						a.isNoData = true;
					}
	            }).catch(function(t) {
	                wx.hideLoading(), wx.showToast({
	                    title: "网络错误，请检查网络",
	                    icon: "none",
	                    duration: 2e3,
	                    mask: !0
	                });
	            });
	        }, 200);
	    },
	    toMalldetail: function(t) {
	        Jump.to(page.index.detail, "id=" + t.guid);
	    },
	    scroll: function(t) {},
	    pullrefresh: function(t) {
	        this.pageNum++, this.getData();
	    },
		handleScroll: function(){
			// 防止重复
			if (this.isExcute) {
				return;
			}
			if (this.isbottom) {
				return;
			}
			var flag = srollEvent.isReachBottom();
			if (!flag) {
				return;
			}
			this.isExcute = true;
			this.pullrefresh();
		},
	    get_location: function() {
	        var t = this;
	      t.longitude = wx.getStorageSync("userLng"), t.latitude = wx.getStorageSync("userLat"), t.getData(t.str);
	    }
	},
	mounted: function() {
		window.addEventListener("scroll", this.handleScroll, {
			passive: false
		});
	},
	created: function() {
		this.isbottom = !1, this.str = URLParam.get("typeId"), this.project_name= URLParam.get("name"), this.get_location();
	}
});